<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{{ title }}</h5>
                </div>
                <div class="ibox-content">

                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>描述</th>
                            <th>图片</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for key,promotional in page.items %}
                        <tr>
                            <td>{{ key+1 }}</td>
                            <td>{{ promotional.des}}</td>
                            <td class="col-md-3"><div class="thumbnail">{{ image('uploads/promotional/'~promotional.src)}}</div></td>
                            <td>
                                <button type="button" class="btn btn-success btn-sm" onclick="location.href='{{  url('promotional/update/id/'~promotional.id) }}'">修改</button>
                                <button type="button" class="btn btn-danger btn-sm" onclick="location.href='{{  url('promotional/delete/id/'~promotional.id) }}'">删除</button>
                            </td>
                        </tr>
                        {% endfor %}
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
        <div class="pull-left">
            <a role="button" class="btn btn-primary btn-lg" href="{{  url('promotional/create') }}">添加</a>
        </div>
        {% if page.total_pages != 0 %}
            <nav class="pull-right">
                <ul class="pagination">
                    <li><span>{{ page.current }}/{{ page.total_pages }}</span></li>
                    <li>{{ link_to("promotional/index", "首页") }}</li>
                    <li>{{ link_to("promotional/index?page="~page.before, "前一页") }}</li>
                    {% for onepage in 1..page.total_pages %}
                        <li>{{ link_to("promotional/index?page="~onepage, onepage) }}</li>
                    {% endfor %}
                    <li>{{ link_to("promotional/index?page="~page.next, "下一页") }}</li>
                    <li>{{ link_to("promotional/index?page="~page.last, "最后一页") }}</li>
                </ul>
            </nav>
        {% endif %}
    </div>

</div>